<table border="0" cellspacing="1" cellpadding="1">
  <tr>
    <th>型号</th>
    <th>名称</th>
    <th>材质</th>
    <th>规格</th>
    <th>件数</th>
    <th>来源</th>
  </tr>
<% unsent_order_made_items.each_with_index do |item,index| %>
  <tr>
    <td><%= item.furniture.furniture_style.code %></td>
    <td><%= item.furniture.furniture_style.name %></td>
    <td><%= item.furniture.material.code %>-<%= item.furniture.material.name %></td>
    <td><%= item.furniture.spec %></td>
    <td class='r'><%= item.order_made_count %></td>
    <td>
      <% if item.source.ordered? %>
      <%= link_to t(item.source), item.order,:target => :_blank, :title => "来自-预订单【#{item.order.order_no}】" %>
      
      
      <% elsif item.source.after_serviced? %>
      <%= link_to t(item.source), item.installation,:target => :_blank, :title => "来自-安装单【#{item.installation.install_no}】" %>
      <% end %>
      <%= fields_for 'order_made_item[]', item do |item_form| %>
        <%= item_form.hidden_field :order_id %>
        <%= item_form.hidden_field :order_item_id %>
        <%= item_form.hidden_field :installation_id %>
        <%= item_form.hidden_field :install_item_id %>
        <%= item_form.hidden_field :furniture_id %>
        <%= item_form.hidden_field :order_made_count %>
      <% end %>
      <%#= hidden_field_tag "order_made_item[][order_id]",item.order_id %>
      <%#= hidden_field_tag "order_made_item[][order_item_id]",item.order_item_id %>
      <%#= hidden_field_tag "order_made_item[][installation_id]",item.installation_id %>
      <%#= hidden_field_tag "order_made_item[][install_item_id]",item.install_item_id %>
      <%#= hidden_field_tag "order_made_item[][furniture_id]",item.furniture_id %>
      <%#= hidden_field_tag "order_made_item[][order_made_count]",item.order_made_count %>
    </td>
  </tr>
<% end %>  
</table>